<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全局函数API</title>
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
    <div ng-app="app01">
        <div  ng-controller="ctrl01a">
            <input type="text" ng-model="x">
            <br/><b>输入的内容：</b>{{x}}
            <br/><b>转小写（lowercase)</b>{{y}}==={{x | lowercase}}
            <br/><b>转大写（upercase)</b>{{z}}===
            <br/><b>{{z}}（isString)</b>{{a}}===
            <br/><b>{{z}}（isNumber)</b>{{b}}===
        </div>
        <div ng-controller="ctrl01b">
            {{ctrl01b_x}}
        </div>
        <div ng-controller="ctrl01c">
            {{ctrl01b_x}}
        </div>
    </div>
    <script>
        var app01=angular.module("app01",[]);
        app01.controller("ctrl01a",function ($scope) {
            $scope.x='abKOFkadfoDKc';
            $scope.y=angular.lowercase($scope.x);
            $scope.z=angular.uppercase($scope.x);
            $scope.a=angular.isString($scope.z);
            $scope.b=angular.isNumber($scope.z);
        });
        app01.controller("ctrl01b",function ($scope,$timeout,$interval) {
            $scope.ctrl01b_x=1000000000;
            $timeout(function () {
                $scope.ctrl01b_x=22;
            },1200);
            $interval(function () {
                $scope.ctrl01b_x=$scope.ctrl01b_x+1;
            },1500);
        });
        app01.controller("ctrl01c",["$scope","$interval",function(e,t){
            e.ctrl01b_x=1;
            t(function(){
                e.ctrl01b_x=e.ctrl01b_x+1;
            },1e3);
        }]);
    </script>
</body>
</html>